package com.papper.mng.domain;

import com.papper.common.enums.ResultEnum;
import com.papper.common.utils.tool.StringTool;

/**
 * @Author:Lajiao
 * @Date:2014年8月21日
 * @Time:下午12:27:57
 * @Description:JSON返回信息
 */
public class DwzResponse {
    /**
     * 响应代码
     */
    private String statusCode;
    /**
     * 响应消息
     */
    private String message;
    private String navTabId;
    private String rel;
    private String callbackType;
    private String forwardUrl;
    private String confirmMsg;

    public DwzResponse() {
    }

    public DwzResponse(String statusCode, String message) {
        this.statusCode = statusCode;
        this.message = message;
    }

    public DwzResponse(String statusCode, String message, String callbackType) {
        this.statusCode = statusCode;
        this.message = message;
        this.callbackType = callbackType;
    }

    public DwzResponse(String statusCode, String message, String navTabId, String rel, String callbackType, String forwardUrl, String confirmMsg) {
        this.statusCode = statusCode;
        this.message = message;
        this.navTabId = navTabId;
        this.rel = rel;
        this.callbackType = callbackType;
        this.forwardUrl = forwardUrl;
        this.confirmMsg = confirmMsg;
    }

    /**
     * 成功
     *
     * @param message
     * @return
     */
    public static DwzResponse success(String message) {
        DwzResponse rb = new DwzResponse();
        rb.setStatusCode(StringTool.nullToEmpty(ResultEnum.SUCCESS.getCode()));
        rb.setMessage(message);
        return rb;
    }

    /**
     * 失败
     */
    public static DwzResponse error(String message) {
        DwzResponse rb = new DwzResponse();
        rb.setStatusCode(StringTool.nullToEmpty(ResultEnum.FAIL.getCode()));
        rb.setMessage(message);
        return rb;
    }

    /**
     * get/set
     */
    public String getStatusCode() {
        return statusCode;
    }

    public void setStatusCode(String statusCode) {
        this.statusCode = statusCode;
    }

    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }

    public String getNavTabId() {
        return navTabId;
    }

    public void setNavTabId(String navTabId) {
        this.navTabId = navTabId;
    }

    public String getRel() {
        return rel;
    }

    public void setRel(String rel) {
        this.rel = rel;
    }

    public String getCallbackType() {
        return callbackType;
    }

    public void setCallbackType(String callbackType) {
        this.callbackType = callbackType;
    }

    public String getForwardUrl() {
        return forwardUrl;
    }

    public void setForwardUrl(String forwardUrl) {
        this.forwardUrl = forwardUrl;
    }

    public String getConfirmMsg() {
        return confirmMsg;
    }

    public void setConfirmMsg(String confirmMsg) {
        this.confirmMsg = confirmMsg;
    }
}
